<div class="sub-main-container">
    <div class="search-wrap">
        <form nz-form [nzLayout]="'inline'" [formGroup]="searchForm">
            <nz-form-item>
                <nz-form-label>日期</nz-form-label>
                <nz-form-control>
                    <nz-date-picker formControlName="ctCreatetime"></nz-date-picker>
                </nz-form-control>
            </nz-form-item>
            <nz-form-item>
                <nz-form-control>
                    <button nz-button nzType="primary" (click)="queryInfo(true)"><i nz-icon nzType="search"></i>查询
                    </button>
                </nz-form-control>
            </nz-form-item>
            <nz-form-item>
                <nz-form-control>
                    <button nz-button (click)="resetQueryInfo()">重置
                    </button>
                </nz-form-control>
            </nz-form-item>
        </form>
        <button nz-button nzType="danger" class="add-btn" (click)="openEditModal()">
            <i nz-icon nzType="plus" nzTheme="outline"></i>新增
        </button>
    </div>

    <div class="main-wrap">
        <nz-table #dataTable
                  class="main-table"
                  [nzData]="tableData"
                  [nzTotal]="total"
                  [nzFrontPagination]="false"
                  [(nzPageIndex)]="pageNum"
                  [(nzPageSize)]="pageSize"
                  [nzLoading]="loading"
                  (nzPageIndexChange)="queryInfo()"
                  nzBordered
                  nzSize="middle">
            <thead>
            <tr>
                <th nzWidth="130px">日期</th>
                <th nzWidth="225px">内容</th>
                <th nzWidth="180px">处理情况</th>
                <th nzWidth="180px">批示</th>
                <th nzWidth="150px">值班调度</th>
                <th nzWidth="150px">值班经理</th>
                <th nzWidth="130px">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let data of dataTable.data">
                <td>{{data.ctCreatetime}}</td>
                <td nzBreakWord class="ellipsis-td">{{data.info}}</td>
                <td nzBreakWord class="ellipsis-td">{{data.processInfo }}</td>
                <td nzBreakWord class="ellipsis-td">{{data.leaderInstructions }}</td>
                <td>{{data.onDutyDispatch }}</td>
                <td>{{data.onDutyManager }}</td>
                <td>
                    <a (click)="openEditModal(data)">详情</a>
                    <nz-divider nzType="vertical"></nz-divider>
                    <a nz-popconfirm nzPopconfirmTitle="确认删除？" nzPopconfirmPlacement="left"
                       (nzOnConfirm)="onDelete(data.id)">
                        删除
                    </a>
                </td>
            </tr>
            </tbody>
        </nz-table>
    </div>

    <nz-modal nzClassName="custom-modal dt-records-modal" nzWidth="760" [(nzVisible)]="modalShow"
              [nzTitle]="modalTitle"
              (nzOnCancel)="onCancel()" (nzOnOk)="onConfirm()">
        <form nz-form [formGroup]="form">
            <div nz-row [nzGutter]="24">
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6" nzRequired>日期</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <nz-date-picker formControlName="ctCreatetime"
                                            nzShowTime
                                            nzFormat="yyyy-MM-dd"
                                            nzPlaceHolder="日期"></nz-date-picker>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="24">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="3" nzRequired>内容</nz-form-label>
                        <nz-form-control [nzSpan]="20">
                            <textarea formControlName="info" nz-input rows="3"></textarea>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="24">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="3" nzRequired>处理情况</nz-form-label>
                        <nz-form-control [nzSpan]="20">
                            <textarea formControlName="processInfo" nz-input rows="2"></textarea>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="24">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="3" nzRequired>领导批示</nz-form-label>
                        <nz-form-control [nzSpan]="20">
                            <textarea formControlName="leaderInstructions" nz-input rows="2"></textarea>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6" nzRequired>值班调度</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="onDutyDispatch" placeholder="值班调度">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6" nzRequired>值班经理</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="onDutyManager" placeholder="值班经理">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6" nzRequired>值班领导</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="onDutyLeader" placeholder="值班领导">
                        </nz-form-control>
                    </nz-form-item>
                </div>
            </div>
        </form>
    </nz-modal>

</div>
